SpatialStream® Code Examples

Subdivision Display and Identify

This example demonstrates how to simply add layers to a map using a Map Layer object. The map layer uses the GetMap functional component to construct web requests and retrieve images, in this case Subdivision data , to display on the map.

GetMap

layer = new Dmp.Layer.WmsLayer("SD", "SS");
layer.addChild("poly", "SS.Planning.MP.Subdivisions/Subdivisions", "SS.Planning.MP.Subdivisions/Styles/SampleDefault.sld.xml", {
zIndex: 100, zoomRange: {
min: 4, max: 19
}
});
layer.addChild("label", "SS.Planning.MP.Subdivisions/Subdivisions", "SS.Planning.MP.Subdivisions/Styles/SampleLabels.sld.xml", {
zIndex: 100, zoomRange: {
min: 17, max: 19
}
});
map.addEntity(layer);

//----------------

var url = "Identify.aspx" +
"?returnGeoType=3" +
"&dataSource=SS.Planning.MP.Subdivisions/Subdivisions" +
"&showSchema=false" +
"&lat=" + loc.latitude +
"&long=" + loc.longitude +
"&fields=*";

Dmp.Env.Connections["SS"].getJson(url, successCallback, errorCallback);


Run Sample   Back To Index